#ifndef MYPLAYLISTMODEL_H
#define MYPLAYLISTMODEL_H

#include "normalplaylistmodel.h"
#include <QList>
#include "EZTally/EZTallyArray.h"
#include "EZTally/EZTallyAutoPtr.h"

#define MyPlayListModel_DB_TABLE "MyPlayListModel_table"
#define MyPlayListModel_Songs_DB_TABLE "myplaymistmodel_songs_table"

class MyPlayListModel : public NormalPlayListModel
{
protected:
    virtual ~MyPlayListModel();
public:
    MyPlayListModel();


    int dbid() const;
    void setDbid(int dbid);

    void addSong(SongModel *song,bool updateDb=false);
    void removeSong(SongModel *song,bool updateDb=false);

    static EZTally::EZTallyAutoPtr playListFromDB();
    static EZTally::EZTallyAutoPtr shareMyPlayList(bool refresh=false);
    void saveToDB();
    bool removeOnDB();
    void fillSongsFromDB();
    void saveSongsToDB();
protected:
    static void checkDBState();


protected:
    int _dbid;
};

#endif // MYPLAYLISTMODEL_H
